package com.jhgsys.internal.sypq.service;

import com.jhgsys.internal.sypq.entity.Resource;
import com.jhgsys.internal.common.entity.QueryRequest;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jhgsys.internal.system.entity.User;

import java.util.List;

/**
 *  Service接口
 *
 * @author ganjun
 * @date 2024-11-10 20:12:58
 */
public interface IResourceService extends IService<Resource> {
    /**
     * 查询（分页）
     * @author ganjun
     * @date 2024-11-10 20:12:58
     * @param request QueryRequest
     * @param resource resource
     * @return IPage<Resource>
     */
    IPage<Resource> findResourcePage(QueryRequest request, String name, String rsPlace);

    /**
     * 导出
     * @author ganjun
     * @date 2024-11-10 20:12:58
     * @param request QueryRequest
     * @return IPage<Resource>
     */
    List<Resource> export(QueryRequest request, String name, String rsPlace);

    /**
     * 查询（所有）
     * @author ganjun
     * @date 2024-11-10 20:12:58
     * @param resource resource
     * @return List<Resource>
     */
    List<Resource> findResourceList(Resource resource);

    /**
    * 根据ID查询
    * @author ganjun
    * @date 2024-11-10 20:12:58
    * @param id
    * @return Resource
    */
    Resource findResourceById(String id);

    /**
     * 新增
     * @author ganjun
     * @date 2024-11-10 20:12:58
     * @param resource resource
     */
    boolean createResource(Resource resource);

    /**
     * 修改
     * @author ganjun
     * @date 2024-11-10 20:12:58
     * @param resource resource
     */
    boolean updateResource(Resource resource);

    /**
     * 逻辑删除
     * @author ganjun
     * @date 2024-11-10 20:12:58
     * @param resource resource
     * @param resourceIds resourceIds
     */
    boolean deleteResource(Resource resource, String resourceIds);

    /**
    * 物理删除
    * @author ganjun
    * @date 2024-11-10 20:12:58
    * @param resourceIds resourceIds
    */
    boolean physicallyDeleteResource(String resourceIds);

    /**
     * 根据角色获取用户
     * @return
     */
    List<User> getUsersByRoleId();

    List<User> getUsersByTenantId(String tenantId);
}
